package com.speech.http;

import com.speech.constant.HttpContant;
import com.speech.entity.BaseEntity;
import com.speech.entity.LoginInfo;
import com.speech.entity.MyProperty;
import com.speech.entity.UserInfo;
import com.speech.result.Result;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by zhangjian
 */
public interface ApiService {

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST(HttpContant.SEND_CODE)
    Call<Result<BaseEntity>> sendCode(@Field("phone") String phone);
    /**
     * 用户注册
     */
    @FormUrlEncoded
    @POST(HttpContant.REGISTE)
    Call<Result<BaseEntity>> registe(@Field("phone") String phone,@Field("password") String password
            ,@Field("inviteCode") String inviteCode,@Field("code") String code);
    /**
     * 用户上传头像
     */
    @Multipart
    @POST(HttpContant.UPLOAD_HEAD)
    Call<Result<BaseEntity>> uploadHead(@Part("uid") RequestBody uid, @Part("token") RequestBody token
            , @Part("deviceId") RequestBody deviceId, @Part MultipartBody.Part file);
    /**
     * 用户登录
     */
    @FormUrlEncoded
    @POST(HttpContant.LOGIN)
    Call<Result<LoginInfo>> login(@Field("phone") String phone, @Field("password") String password
            , @Field("deviceId") String deviceId);
    /**
     * 用户首页个人信息
     */
    @FormUrlEncoded
    @POST(HttpContant.USER_INFO)
    Call<Result<UserInfo>> userInfo(@Field("uid") String uid, @Field("deviceId") String deviceid
            , @Field("token") String token);
    /**
     * 修改昵称
     */
    @FormUrlEncoded
    @POST(HttpContant.UPDATE_NICK)
    Call<Result<BaseEntity>> updateNick(@Field("uid") String uid,@Field("deviceId") String deviceid
            ,@Field("token") String token,@Field("nickname") String nickname);
    /**
     * 资产明细
     */
    @FormUrlEncoded
    @POST(HttpContant.MYPROPERTY)
    Call<Result<MyProperty>> myProperty(@Field("uid") String uid, @Field("deviceId") String deviceid
            , @Field("token") String token);
    /**
     * 基础任务-加入社区/关注公众号
     */
    @FormUrlEncoded
    @POST(HttpContant.MISSION)
    Call<Result<BaseEntity>> mission(@Field("uid") String uid,@Field("token") String token
            ,@Field("deviceId") String deviceId,@Field("type") String type,@Field("code") String code);
    /**
     * 超级任务完成情况
     */
    @FormUrlEncoded
    @POST(HttpContant.SUPPER_TASK)
    Call<Result<BaseEntity>> supperTask(@Field("uid") String uid,@Field("token") String token
            ,@Field("deviceId") String deviceId);
    /**
     * 用户提交意见
     */
    @FormUrlEncoded
    @POST(HttpContant.SUGGESTION)
    Call<Result<BaseEntity>> suggestion(@Field("uid") String uid,@Field("deviceId") String deviceId
            ,@Field("token") String token,@Field("text") String text);
    /**
     * 版本更新
     */
    @FormUrlEncoded
    @POST(HttpContant.UP_APP)
    Call<Result<BaseEntity>> upApp(@Field("uid") String uid,@Field("deviceId") String deviceId
            ,@Field("token") String token,@Field("version") String version);

}
